package com.idea.zd.sys.quartz;

import com.jfinal.kit.HttpKit;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;

import java.util.logging.Logger;

import static java.util.logging.Logger.getLogger;

public class IqiyiJobWeek implements Job {
    private static final Logger log = getLogger(String.valueOf(IqiyiJobWeek.class));

    @Override
    public void execute(JobExecutionContext context) throws JobExecutionException {
        IqiyiJob2 joby1 = new IqiyiJob2(100,1);
        IqiyiJob2 joby2 = new IqiyiJob2(200,101);
        IqiyiJob2 joby3 = new IqiyiJob2(300,201);
        IqiyiJob2 joby4 = new IqiyiJob2(400,301);
        IqiyiJob2 joby5 = new IqiyiJob2(500,401);

        Thread t6 = new Thread(joby1,"周线程6");
        Thread t7 = new Thread(joby2,"周线程7");
        Thread t8 = new Thread(joby3,"周线程8");
        Thread t9 = new Thread(joby4,"周线程9");
        Thread t10 = new Thread(joby5,"周线程10");

        t6.start();
        t7.start();
        t8.start();
        t9.start();
        t10.start();

        try {
            t6.join();
            t7.join();
            t8.join();
            t9.join();
            t10.join();

        } catch (InterruptedException e) {
            e.printStackTrace();
        }

        HttpKit.post("http://app.fansiji.com/h5/iqiyi/Home/week","");
        log.info("http://app.fansiji.com/h5/iqiyi/Home/week");
        System.out.println("http://app.fansiji.com/h5/iqiyi/Home/week");
        HttpKit.post("http://api.fansiji.com/sys_db/getAiqiyiUrl","");
        log.info("http://api.fansiji.com/sys_db/getAiqiyiUrl");
        System.out.println("http://api.fansiji.com/sys_db/getAiqiyiUrl");
        HttpKit.post("http://app.fansiji.com/h5/iqiyi/Home/index","");
        log.info("http://app.fansiji.com/h5/iqiyi/Home/index");
        System.out.println("http://app.fansiji.com/h5/iqiyi/Home/index");
        HttpKit.post("http://app.fansiji.com/h5/iqiyi/Home/month","");
        log.info("http://app.fansiji.com/h5/iqiyi/Home/month");
        System.out.println("http://app.fansiji.com/h5/iqiyi/Home/month");
    }
}
